package cn.exrick.xboot.common.utils;
import org.springframework.data.domain.Page;
import cn.exrick.xboot.modules.gatestation.entity.NaturalgasGateStation;

/**
 * @ClassNameCustomPageUtil
 * @Description
 * @Author yck
 * @Date2020-07-29 14:56
 * @Version V1.0
 **/
public class CustomPageUtil {

    public static CustomPage getCustomPage(Page page){
        CustomPage customPagepage=new  CustomPage();
        customPagepage.setTotalRows((int)page.getTotalElements());
        customPagepage.setPageSize(page.getSize());
        customPagepage.setTotalPages(page.getTotalPages());
        customPagepage.setPageNumber(page.getNumber()+1);
        customPagepage.setResultData(page.getContent());
        return customPagepage;
    }
}
